{smcl}
{txt}{sf}{ul off}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}E:\Github\Bolivia\00_replication_files\log-files/2_Figure_H4.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}25 Jan 2022, 22:39:59
{txt}
{com}. 
. timer on 2
{txt}
{com}. 
. *------------*
. * Figure H.4 *
. *------------*
.         * Figure H.4.a
.         *-------------
.                 import excel using "data/inputs/2_Peru2021Runoff.xlsx", clear
{res}{txt}
{com}. 
.                 keep B F I
{txt}
{com}.                 rename B actas_cont
{res}{txt}
{com}.                 rename F ppnpl
{res}{txt}
{com}.                 rename I fp
{res}{txt}
{com}. 
.                 drop if _n==1
{txt}(1 observation deleted)

{com}. 
.                 destring actas_cont ppnpl fp, replace
{txt}actas_cont: all characters numeric; {res}replaced {txt}as {res}double
{txt}ppnpl: all characters numeric; {res}replaced {txt}as {res}double
{txt}fp: all characters numeric; {res}replaced {txt}as {res}double
{txt}
{com}. 
.                 gen margin_castillo=ppnpl-fp
{txt}
{com}. 
.                 twoway (line margin_castillo actas_cont, lwidth(thick) lcolor(midblue)), ///
>                         graphregion(color(white)) xlabel(40(10)100) ylabel(,angle(0)) ///
>                         xtitle("Percentage of Tally Sheets Accounted For") ///
>                         ytitle("Perú Libre Margin") ///
>                         legend(off)     yline(0, lpattern(dash) lcolor(black))
{res}{txt}
{com}.                 graph export "outputs/generated/Figure_H4a.pdf", replace
{txt}(file outputs/generated/Figure_H4a.pdf written in PDF format)

{com}. 
.         * Figure H.4.b
.         *-------------
.                 twoway (line fp actas_cont, lwidth(thick) lcolor(gs6)) ///
>                         (line ppnpl actas_cont, lwidth(thick) lcolor(midblue)), ///
>                         graphregion(color(white)) xlabel(40(10)100) ylabel(,angle(0)) ///
>                         xtitle("Percentage of Tally Sheets Accounted For") ///
>                         ytitle("Cumulative Vote Share") ///
>                         legend(cols(1) lab(1 "Fuerza Popular") lab(2 "Perú Libre") ///
>                                 pos(1) ring(0))
{res}{txt}
{com}.                 graph export "outputs/generated/Figure_H4b.pdf", replace
{txt}(file outputs/generated/Figure_H4b.pdf written in PDF format)

{com}. 
. *------------------------------------------------------------------------------*
. timer off 2
{txt}
{com}. timer list 2
{res}   2:      0.96 /        1 =       0.9560
{txt}
{com}. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}E:\Github\Bolivia\00_replication_files\log-files/2_Figure_H4.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}25 Jan 2022, 22:40:00
{txt}{.-}
{smcl}
{txt}{sf}{ul off}